<?php

use Illuminate\Support\Facades\Route;


Route::group(['namespace' => 'rbac','middleware'=>'login'], function () {

    //用户列表
    Route::get('adminPage', [\App\Http\Controllers\rbac\AuthController::class, 'adminPage'])->name('adminPage');
//    用户添加页面
    Route::get('adminCreate', [\App\Http\Controllers\rbac\AuthController::class, 'adminCreate'])->name('adminCreate');
//    执行添加
    Route::post('doSave', [\App\Http\Controllers\rbac\AuthController::class, 'doSave']);
//    用户分配角色
    Route::get('allotRole/{user}', [\App\Http\Controllers\rbac\AuthController::class, 'allotRole'])->name('allotRole');
    Route::post('allotRole/{user}', [\App\Http\Controllers\rbac\AuthController::class, 'allotRole'])->name('allotRole');

    //角色列表
    Route::get('rolePage', [\App\Http\Controllers\rbac\RoleController::class, 'rolePage'])->name('rolePage');
//    角色添加页面
    Route::get('createRole', [\App\Http\Controllers\rbac\RoleController::class, 'createRole'])->name('createRole');
//    执行添加
    Route::post('roleSave', [\App\Http\Controllers\rbac\RoleController::class, 'roleSave'])->name('roleSave');
//    角色分配权限
    //    角色分配权限
//    Route::get('/role_node/{role}', [RoleController::class, 'role_node'])->name('role_node');
////    执行角色分配
//    Route::post('/nodeSave/{role}', [RoleController::class, 'nodeSave'])->name('nodeSave');
    Route::get('roleNode/{role}', [\App\Http\Controllers\rbac\RoleController::class, 'roleNode'])->name('roleNode');
    Route::post('nodeSave/{role}', [\App\Http\Controllers\rbac\RoleController::class, 'nodeSave'])->name('nodeSave');

    //节点列表
    Route::get('nodePage', [\App\Http\Controllers\rbac\NodeController::class, 'nodePage'])->name('nodePage');
    //节点添加页面
    Route::get('nodeCreate', [\App\Http\Controllers\rbac\NodeController::class, 'nodeCreate'])->name('nodeCreate');
    //节点执行添加
    Route::post('doNode', [\App\Http\Controllers\rbac\NodeController::class, 'doNode'])->name('doNode');

});
